<!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *      
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License
-->

<html>
  <head>
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
      _gaq.push(['_trackPageview']);
      
      (function() {
        var ga = document.createElement('script');
        ga.type = 'text/javascript';
        ga.async = true;
        ga.src = ('https:'   == document.location.protocol ? 'https://ssl'   : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(ga, s);
      })();
    </script>
    <script src="//talkgadget.google.com/talkgadget/apps/gadgets/js/rpc.js"></script>
    <script src="//talkgadget.google.com/hangouts/_/api/hangout.js?v=1.2"></script>
    <script src="//www.youtube.com/iframe_api"></script>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
    <script src="/static/overlays.js"></script>
    <script src="/static/youtube.js"></script>
    <script type="text/javascript">
      // We take care of dependencies first
      var deps = {
        'hangouts': 0,
        'jquery': 0,
        'youtube': 0
      };
      
      // YouTube Iframe API loaded
      function onYouTubeIframeAPIReady() {
        depReady('youtube');
      };
      // Hangout API loaded
      gapi.hangout.onApiReady.add(function () {
        depReady('hangouts');
      });
      
      // jquery and DOM loaded
      $(document).ready(function(){
        depReady('jquery');
      });

      function depReady(dep) {
        deps[dep] = 1;
        if(deps.jquery && deps.hangouts && deps.youtube) {
          initOverlays();
          initYouTube();
        }
      }
    </script>
  </head>
  <body>
  </body>
</html>